package com.couldsail.takeaway.pojo.vo;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.couldsail.takeaway.pojo.entity.Coupon;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;

@Data
@TableName("user_coupon")
@Schema(description = "用户优惠券")
public class UserCouponVO {
    @Schema(description = "主键ID")
    private String id;

    @Schema(description = "优惠券ID")
    private String couponId;

    @Schema(description = "优惠券状态：未使用-UNUSED, 已使用-USED, 已过期-EXPIRED")
    private String status;  // UNUSED, USED, EXPIRED

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @Schema(description = "获取时间")
    private LocalDateTime obtainedTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @Schema(description = "使用时间")
    private LocalDateTime usedTime;

    @Schema(description = "优惠劵详情")
    private CouponVO couponVO;
}